<?php
/**
 *   This file is part of GeoArticle (a Joomla plugin).
 *   Written by Ivar Bergman (www.ivarbergman.se)
 *   Copyright (c) 2010 Ivar Bergman. All rights reserved.
 *
 *   GeoArticle is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   GeoArticle is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with GeoArticle.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

  // no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

jimport('joomla.application.component.view');

class GeoArticleGeoTags extends JView {
  function display($tpl = null)
  {
    global $mainframe, $option;
    
    $db  =& JFactory::getDBO();
    $uri =& JFactory::getURI();
    
    $a_errors = array();
    $geoarticle = NULL;
    
    $db->setQuery(sprintf( 'SELECT c.title, c.introtext, c.fulltext, c.state, g.long, g.lat FROM #__content AS c, #__content_geoarticle_geo AS g WHERE c.id=g.cid AND state=1'));
        
    $geo = $db->loadObjectList();        
    if ($db->getErrorNum())
      $a_errors[] = 'Error while fetching geoarticle from database: '.$db->getErrorMsg();

    print_r($geo);
    exit();
    $this->assignRef('geo', $geo);
    $this->assignRef('errors', $a_errors);

    return parent::display($tpl);
  }
  
}

?>